<style>
    .form-group .col-sm-4{
        padding-bottom: 5px;
    }
    .nav-tabs{
        border-bottom: unset;
    }
    #extra1 .form-group .col-sm-2{padding-right: 0px;}
    .progress-bar {
        color: #020202;
        background-image: linear-gradient(to right, #4969e6, #1ac6f2);
    }
</style>

<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
    <div class="col-md-12 col-sm-12">
        <div class="panel panel-default ">
            <div class="panel-heading">
                <div class="panel-lead">
                    <div class="panel-title">
                        <span style="font-weight: bold;font-style: normal;">{:__('基本信息')}</span>

                        <small style="margin-left: 10px;" class=" label bg-purple">总消费：{$row.purchase_total}</small>
                        <small style="margin-left: 10px;" class=" label bg-blue">下单：{$row.purchase_times}次</small></label>
                        <small style="margin-left: 10px;" class=" label bg-green">
                            {php}
                            $deal_time= \addons\facrm\library\Helper::timeTran($row['deal_time']);
                            echo  $deal_time?$deal_time.'下单':'无下单';
                            {/php}
                        </small>

                        <span class="label label-primary pull-right">
                            <a href="#" onclick="javascript:parent.Fast.api.open('facrm/customer/index/edit/ids/{$row.id}',__('修改客户信息-')+'{$row.name}');"> {:__('修改')}</a>
                        </span>
						{if($auth->check('facrm/customer/project/index'))}
						<span class="label label-danger pull-right" style="margin-right: 10px;">
                            <a href="javascript:void(0);" data-url="{$row.project_link}" data-area="['98%','98%']" class="btn-addtabs" data-original-title="{:__('项目-')}{$row.name}" data-title="{:__('项目-')}{$row.name}" style="color: #FFFFFF">{:__('项目')}</a>
                        </span>
						{/if}
                    </div>
                </div>
            </div>
            <div class="panel-body">
				<div class="col-md-6 col-xs-12 form-group">
					<label  class="control-label col-xs-12 col-sm-2">{:__('客户名称')}:</label>
					<div class="col-xs-12 col-sm-8 ">
						<label class="control-label">
							{$row.name}({$row.id})
							{if $row['tags']}
							<span class="label label-primary">{$row['tags']}</span>
							{/if}
						</label>
					</div>
				</div>
				<div class="col-md-6 col-xs-12 form-group">
					<label  class="control-label col-xs-12 col-sm-2">{:__('服务阶段')}:</label>
					<div class="col-xs-12 col-sm-8 ">
						<label class="control-label">{$followStatusList[$row.follow_status]}</label>
					</div>
				</div>
				<div class="col-md-6 col-xs-12 form-group">
					<label  class="control-label col-xs-12 col-sm-2">{:__('联系电话')}:</label>
					<div class="col-xs-12 col-sm-8 ">
						<label class="control-label">{$row.telephone}</label>
					</div>
				</div>
				<div class="col-md-6 col-xs-12 form-group">
					<label  class="control-label col-xs-12 col-sm-2">{:__('联系手机')}:</label>
					<div class="col-xs-12 col-sm-8 ">
						<label class="control-label">{$row.mobile}</label>
					</div>
				</div>
				<div class="col-md-6 col-xs-12 form-group">
					<label  class="control-label col-xs-12 col-sm-2">{:__('客户等级')}:</label>
					<div class="col-xs-12 col-sm-8 ">
						<label class="control-label">{$levelList[$row.level]}</label>
					</div>
				</div>
				<div class="col-md-6 col-xs-12 form-group">
					<label  class="control-label col-xs-12 col-sm-2">{:__('客户来源')}:</label>
					<div class="col-xs-12 col-sm-8 ">
						<label class="control-label">{$sourceList[$row.source]}</label>
					</div>
				</div>
				<div class="col-md-6 col-xs-12 form-group">
					<label  class="control-label col-xs-12 col-sm-2">{:__('地址')}:</label>
					<div class="col-xs-12 col-sm-8 ">
						<label class="control-label">{$row.area_text}</label>
					</div>
				</div>
				<div class="col-md-6 col-xs-12 form-group">
					<label  class="control-label col-xs-12 col-sm-2">{:__('详细地址')}:</label>
					<div class="col-xs-12 col-sm-8 ">
						<label class="control-label">{$row.detail_address}</label>
					</div>
				</div>
				<div class="col-md-6 col-xs-12 form-group">
					<label  class="control-label col-xs-12 col-sm-2">{:__('当前服务')}:</label>
					<div class="col-xs-12 col-sm-8 ">
						<label class="control-label">{$row.service}</label>
					</div>
				</div>
				<div class="col-md-6 col-xs-12 form-group">
					<label  class="control-label col-xs-12 col-sm-2">{:__('近期重点')}:</label>
					<div class="col-xs-12 col-sm-8 ">
						<label class="control-label">{$row.keynote}</label>
					</div>
				</div>
				<div id="extend"></div>
				<div class="col-md-12 col-xs-12 form-group">
					<label  class="control-label col-xs-12 col-md-1 col-sm-2">{:__('基本情况')}:</label>
					<div class="col-xs-12 col-md-11 col-sm-10 " id="remark-box" style="overflow: auto; max-height: 300px;">
						{$row.remark}
					</div>
				</div>
        </div>
    </div>
</form>

    <div class="col-md-12 col-sm-12">
    {include file="facrm/customer/index/tables" /}

    </div>
					    
	
    <div class="form-group fixed-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">

            <button type="button" class="btn  btn-send-email  bg-purple {:$auth->check('facrm/apps/email/send')?'':'hide'} "
                    data-url="facrm/apps/email/send"
                    data-types="customer"
                    data-typesid="{$row.id}"
                    data-title="{:__('发邮件给客户：')}{$row.name}">{:__('发邮件')}</button>

            <button type="button" class="btn  btn-send-sms  btn-info {:$auth->check('facrm/apps/sms/send')?'':'hide'} "
                    data-url="facrm/apps/sms/send"
                    data-types="customer"
                    data-typesid="{$row.id}"
                    data-title="{:__('发信息给客户：')}{$row.name}">{:__('发信息')}</button>
            {if($auth->check('facrm/customer/index/next'))}
            <a class="btn  btn-primary  btn-next " href="javascript:;"
               data-title="{:__('下一个客户')}"
               data-url="facrm/customer/index/next">{:__('下一个')}</a>

            {/if}
            {if($auth->check('facrm/customer/index/deal')||$auth->check('facrm/contract/index/contractadd'))}
            <button type="button" class="btn  btn-success btn-dialog"
                    data-title="{:__('成交')}：{$row.name}"
                    data-url="{if $addon_config['deal']==1}facrm/customer/index/deal/ids/{$row.id}{else/}facrm/contract/index/contractadd/customer_id/{$row.id}{/if}">{:__('成交')}</button>

            {/if}

        </div>
    </div>
<script>
    var customer_id={:input('ids')};
    var record_type_list={:json_encode($record_type_list)};
    var jobs_obj={:json_encode($w_config_jobs)};
</script>



